package org.agora.games.bodybuilder;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author : Arash Bizhanzadeh <arashbi@gmail.com>
 *         Date: 12-01-11
 *         Time: 10:30 PM
 */
public class FixtureParameters extends JDialog {
    private JTextField restitution;
    private JTextField density;
    private JTextField friction;
    private JButton okButton;
    private JButton cancelButton;

    public FixtureParameters(JFrame parent, boolean t){
        super(parent,t);
        restitution = new JTextField();
        density = new JTextField();
        friction = new JTextField();
        okButton = new JButton("OK");
        okButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                dispose();
            }
        });
        cancelButton  = new JButton("Cancel");
        cancelButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                dispose();
            }
        });
        setLayout(new BorderLayout());
        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS));
        buttonPanel.add(okButton);
        buttonPanel.add(cancelButton);
        add(buttonPanel,BorderLayout.SOUTH);
        
        JPanel content = new JPanel();
        content.setLayout(new GridLayout(0,2));
        content.add(new JLabel("Density"));
        content.add(density);
        content.add(new JLabel("Friction"));
        content.add(friction);
        content.add(new JLabel("Restitution"));
        content.add(restitution);
        add(content,BorderLayout.CENTER);

    }
}
